package com.fxd.serviceproduct.controller;

import com.fxd.model.product.bean.Product;
import com.fxd.serviceproduct.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author xudongfu
 * @date 2025/06/08
 */
@RequestMapping("/api/product")
@RestController
public class ProductController {

    @Autowired
    private ProductService productService;

    @GetMapping("/product/{productId}")
    public Product getProductById(@PathVariable("productId") Long productId,
                                  @RequestHeader("X-Token") String XToken) {

        System.out.println("hello: " + XToken);
        return productService.getProductById(productId);

    }
}
